package edu.iss.demo.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import edu.iss.demo.model.LeaveApplication;
import edu.iss.demo.service.LeaveApplicationService;


@Controller
public class MangerController 
{
	//Manager Navigation Pages
	@Autowired
	private LeaveApplicationService LAService;
	@RequestMapping(value = "/manager/detailApproveRejectLeave/{id}", method = RequestMethod.POST)
	public ModelAndView managerViewEmplLeave()
	{
		return new ModelAndView("m_detailApproveRejectLeave");
	}
	
	
	
	
	@RequestMapping(value = "/manager/viewAllEmpHistory", method = RequestMethod.GET)
	public ModelAndView managerViewEmp()
	{
		return new ModelAndView("m_viewAllEmpHistory");
		
	}
	
	//Manager Logic Pages
	//manager new pages
	@RequestMapping(value = "/manager/ApproveRejectLeave", method = RequestMethod.GET)
	public ModelAndView ApproveRejectLeave()
	{
		ModelAndView mav = new ModelAndView("m_ApproveRejectLeave");
		List<LeaveApplication> LeaveList = LAService.findAll();
		mav.addObject("LeaveList", LeaveList);
		return mav;
	}
	@RequestMapping(value = "/manager", method = RequestMethod.GET)
	public ModelAndView managerView()
	{
		return new ModelAndView("m_ApproveRejectLeave");
	}
	@RequestMapping(value = "/manager/Report", method = RequestMethod.GET)
	public ModelAndView Report()
	{
		return new ModelAndView("m_reports");
	}

}
